<?php

namespace app\admin\model\order;

use think\Model;

/**
 * Info
 */
class Info extends Model
{
    // 表名
    protected $name = 'order_info';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;


    public function user(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\User::class, 'user_id', 'id');
    }

    public function carInfo(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\car\Info::class, 'car_info_id', 'id');
    }

    public function orderType(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\order\Type::class, 'order_type_id', 'id');
    }

    public function purposeInfo(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\purpose\Info::class, 'purpose_info_id', 'id');
    }

    public function insuranceInfo(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\insurance\Info::class, 'insurance_info_id', 'id');
    }

    public function insuranceSalesman(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\insurance\Salesman::class, 'insurance_salesman_id', 'id');
    }
}